package org.code.mallspringboot.service.impl;

import org.code.mallspringboot.dto.SmsCouponDto;
import org.code.mallspringboot.mapper.SmsCouponMapper;
import org.code.mallspringboot.pojo.SmsCoupon;
import org.code.mallspringboot.service.SmsCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class SmsCouponServiceImpl implements SmsCouponService{

    @Autowired
    private SmsCouponMapper smsCouponMapper;

    @Override
    public List<SmsCoupon> selectPage(Integer pageNum, Integer pageSize, Integer type, String name) {
        return smsCouponMapper.selectPage((pageNum - 1) * pageSize, pageSize, type, name);
    }

    @Override
    public int total(Integer type, String name) {
        return smsCouponMapper.total(type, name);
    }

    @Override
    public SmsCoupon selectById(int id) {
        return smsCouponMapper.selectById(id);
    }

    @Override
    public int update(SmsCouponDto smsCouponDto) {
        return smsCouponMapper.update(smsCouponDto);
    }

    @Override
    public int add(SmsCouponDto smsCouponDto) {
        return smsCouponMapper.add(smsCouponDto);
    }

    @Override
    public int delete(int id) {
        return smsCouponMapper.delete(id);
    }
}




